﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _04NumberRepeat
{
    class Program
    {
        static int NumberRepeat(int[] array, int number)
        {
            int count = 0;
            for (int i = 0; i < array.Length; i++)
            {
                if (array[i] == number)
                {
                    count++;
                }
            }
            return count;
        }
        static void Main(string[] args)
        {
            Console.Write("What integer are we looking for:");
            int number = int.Parse(Console.ReadLine());
            Console.WriteLine("Enter size if the array:");
            int arraySize = int.Parse(Console.ReadLine());
            int[] array = new int[arraySize];
            for (int i = 0; i < array.Length; i++)
            {
                Console.Write("array[{0}]:", i);
                array[i] = int.Parse(Console.ReadLine());
            }
            int repeat = NumberRepeat(array, number);
            Console.WriteLine("The number appears {0} times in the array.", repeat);
        }
    }
}
